package com.etc.service.impl;

import com.etc.dao.CommodityDao;
import com.etc.dto.CommodityInventory;
import com.etc.dto.CountsStock;
import com.etc.entity.Commodity;
import com.etc.service.CommodityService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class CommodityServiceImpl implements CommodityService {
    @Resource
    CommodityDao commodityDao;

    public List<Commodity> queryAllCommodity(Integer id) {
        return commodityDao.queryAllCommodity(id);
    }

    @Override
    public List<CommodityInventory> queryAllCommodityInventory(Integer id) {
        return commodityDao.queryAllCommodityInventory(id);
    }

    @Override
    public List<Commodity> queryAllCount(Integer id) {
        return commodityDao.queryAllCount(id);
    }

    @Override
    public int modifyState(int goodid,int groundingid)
    {

        return commodityDao.modifyState(goodid,groundingid);
    }

    @Override
    public int delectAllGoods(int businessid, int goodsid) {
        int i=0;
        int y=0;
        y=  commodityDao.delectIdGoods_sku(goodsid);
     i=   commodityDao.delectIdGoods(businessid,goodsid);


        return i+y;
    }
}
